<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2022/1/4 0004
 * Time: 15:02
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);


namespace app\common\business;

use app\common\model\MallAgreement as ModelObj;
use think\Exception;

class Agreement extends Base
{
    /**
     * @var ValObj
     */
    protected ValObj $valObj;
    /**
     * @var ModelObj
     */
    protected ModelObj $modelObj;

    /**
     *
     */
    public function __construct()
    {
        $this->modelObj = new ModelObj();
    }

    /**
     * 入驻协议
     * @return array|\think\Model|null
     * @throws Exception
     */
    public function getAgreementInfo($type=1){
        try {
            $oinfo = $this->modelObj->getModelByInfo([['type','=',$type]],'*');
        } catch (\Exception $e) {
            throw new Exception($e->getMessage());
        }
        return $oinfo;
    }
}